package com.cd.form.jpa.domian;

import com.cd.common.domain.BaseDomain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import java.util.Date;

@Data
@Entity
@Table(name = "db_form_instance")
@NoArgsConstructor
@AllArgsConstructor
public class FormInstance extends BaseDomain {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "form_id")
    private Long formId;

    //场次
    @Column(name = "name")
    private String name;

    //时间
    @Column(name = "time")
    private Date time;

    //截止日期
    @Column(name = "deadline")
    private Date deadline;

    //是否需要审批 默认不需要
    @Column(name = "is_approval", columnDefinition = "TINYINT(1) DEFAULT 0")
    private Boolean isApproval;

    //结果是否允许别人查看
    @Column(name = "is_result_visible", columnDefinition = "TINYINT(1) DEFAULT 0")
    private Boolean isResultVisible;
}
